home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / UCRASM25.ARJ / INTERSET.ASM < prev    next >
Assembly Source File  |  1991-10-12  |  813b  |  53 lines

  1. StdGrp        group    stdlib,stddata
  2. stddata        segment    para public 'sldata'
  3. stddata        ends
  4. ;
  5. stdlib        segment    para public 'slcode'
  6.         assume    cs:stdgrp
  7. ;
  8. ;
  9. ; intersect-    Intersects one set with another.
  10. ;
  11. ; inputs:
  12. ;
  13. ;    ES:DI-  Points at the destination set (at its mask byte).
  14. ;    DX:SI-    Points at the mask byte of the source set.
  15. ;
  16. ;
  17. ;
  18.         public    sl_intersect
  19. ;
  20. sl_intersect    proc    far
  21.         push    ds
  22.         push    ax
  23.         push    cx
  24.         push    si
  25.         push    di
  26.         mov    ds, dx
  27. ;
  28.         mov    al, es:[di]        ;Get mask bytes
  29.         not    al
  30.         mov    ah, [si]
  31.         add    si, 8            ;Skip to start of set
  32.                 add    di, 8
  33.         mov    cx, 256
  34. IsectLp:    test    ah, [si]
  35.         jnz    Next
  36.         and    es:[di], al
  37. Next:        inc    si
  38.         inc    di
  39.         loop    IsectLp
  40. ;
  41.         pop    di
  42.         pop    si
  43.         pop    dx
  44.         pop    cx
  45.         pop    ax 
  46.         pop    ds
  47.         ret
  48. sl_intersect    endp
  49. ;
  50. ;
  51. stdlib        ends
  52.         end
  53.